#pragma once
#include "Header.h"
#include "resource.h"

class CDlg : public CDialogImpl<CDlg>
{
    CSimpleDialog<IDD_DIALOG_ABOUT> AboutDlg;

public:
    BEGIN_MSG_MAP(CDlg)
        MESSAGE_HANDLER(WM_CLOSE, OnClose)
        MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
        COMMAND_HANDLER(IDC_BTN_ABOUT, BN_CLICKED, OnAbout)
    END_MSG_MAP()

    enum { IDD = IDD_DIALOG_TEST };

    LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
    {
        CenterWindow();
        return 0;
    }

    LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
    {
        EndDialog(0);
        return 0;
    }

    LRESULT OnAbout(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
    {
        AboutDlg.DoModal();
        return 0;
    }
};
